3.466 \(\int \sec ^4(c+d x) (a+i a \tan (c+d x))^n \, dx\)

Optimal. Leaf size=65 \[ \frac {i (a+i a \tan (c+d x))^{n+3}}{a^3 d (n+3)}-\frac {2 i (a+i a \tan (c+d x))^{n+2}}{a^2 d (n+2)} \]

[Out]

-2*I*(a+I*a*tan(d*x+c))^(2+n)/a^2/d/(2+n)+I*(a+I*a*tan(d*x+c))^(3+n)/a^3/d/(3+n)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3487, 43} \[ \frac {i (a+i a \tan (c+d x))^{n+3}}{a^3 d (n+3)}-\frac {2 i (a+i a \tan (c+d x))^{n+2}}{a^2 d (n+2)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^4*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-2*I)*(a + I*a*Tan[c + d*x])^(2 + n))/(a^2*d*(2 + n)) + (I*(a + I*a*Tan[c + d*x])^(3 + n))/(a^3*d*(3 + n))

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \sec ^4(c+d x) (a+i a \tan (c+d x))^n \, dx &=-\frac {i \operatorname {Subst}\left (\int (a-x) (a+x)^{1+n} \, dx,x,i a \tan (c+d x)\right )}{a^3 d}\\ &=-\frac {i \operatorname {Subst}\left (\int \left (2 a (a+x)^{1+n}-(a+x)^{2+n}\right ) \, dx,x,i a \tan (c+d x)\right )}{a^3 d}\\ &=-\frac {2 i (a+i a \tan (c+d x))^{2+n}}{a^2 d (2+n)}+\frac {i (a+i a \tan (c+d x))^{3+n}}{a^3 d (3+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 13.53, size = 143, normalized size = 2.20 \[ -\frac {i 2^{n+3} e^{4 i (c+d x)} \left (e^{i d x}\right )^n \left (\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^n \left (e^{2 i (c+d x)}+n+3\right ) \sec ^{-n}(c+d x) (\cos (d x)+i \sin (d x))^{-n} (a+i a \tan (c+d x))^n}{d (n+2) (n+3) \left (1+e^{2 i (c+d x)}\right )^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^4*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-I)*2^(3 + n)*E^((4*I)*(c + d*x))*(E^(I*d*x))^n*(E^(I*(c + d*x))/(1 + E^((2*I)*(c + d*x))))^n*(3 + E^((2*I)*
(c + d*x)) + n)*(a + I*a*Tan[c + d*x])^n)/(d*(1 + E^((2*I)*(c + d*x)))^3*(2 + n)*(3 + n)*Sec[c + d*x]^n*(Cos[d
*x] + I*Sin[d*x])^n)

________________________________________________________________________________________

fricas [B]  time = 0.69, size = 141, normalized size = 2.17 \[ \frac {{\left ({\left (-8 i \, n - 24 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} - 8 i \, e^{\left (6 i \, d x + 6 i \, c\right )}\right )} \left (\frac {2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n}}{d n^{2} + 5 \, d n + {\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, {\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, {\left (d n^{2} + 5 \, d n + 6 \, d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+I*a*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

((-8*I*n - 24*I)*e^(4*I*d*x + 4*I*c) - 8*I*e^(6*I*d*x + 6*I*c))*(2*a*e^(2*I*d*x + 2*I*c)/(e^(2*I*d*x + 2*I*c)
+ 1))^n/(d*n^2 + 5*d*n + (d*n^2 + 5*d*n + 6*d)*e^(6*I*d*x + 6*I*c) + 3*(d*n^2 + 5*d*n + 6*d)*e^(4*I*d*x + 4*I*
c) + 3*(d*n^2 + 5*d*n + 6*d)*e^(2*I*d*x + 2*I*c) + 6*d)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{4}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+I*a*tan(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((I*a*tan(d*x + c) + a)^n*sec(d*x + c)^4, x)

________________________________________________________________________________________

maple [C]  time = 0.92, size = 1668, normalized size = 25.66 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4*(a+I*a*tan(d*x+c))^n,x)

[Out]

-8*I/(exp(2*I*(d*x+c))+1)^3/(3+n)/d/(2+n)*(2^n*a^n/((exp(2*I*(d*x+c))+1)^n)*(exp(I*(Re(d*x)+Re(c)))^n)^2*exp(-
2*n*Im(d*x)-2*n*Im(c))*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c)))^3*Pi*n)*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2*I
*(d*x+c))+1))^3*Pi*n)*exp(I*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+c)))*Pi*n)*exp(-1/2*I*csgn(I*exp(2*I*
(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a)*Pi*n)*exp(-1/2*I*csgn
(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*Pi*n)*exp(6*I*d*x)*exp(-1/2*I*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(
2*I*(d*x+c)))^3*Pi*n)*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I
/(exp(2*I*(d*x+c))+1))*Pi*n)*exp(1/2*I*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*Pi*n)*exp(1
/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*Pi*n)*exp
(1/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*Pi*n)*exp(1/2*I*csgn(I*exp
(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*Pi*n)*exp(6*I*c)+n/((exp(2*I*(d*x+c))+1)^n)*(ex
p(I*(Re(d*x)+Re(c)))^n)^2*a^n*2^n*exp(-2*n*Im(d*x)-2*n*Im(c))*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2
*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+c))+1))*Pi*n)*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2
*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a)*Pi*n)*exp(1/2*I*csgn(I*a/(exp(2*I*(d
*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*Pi*n)*exp(4*I*d*x)*exp(I*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+
c)))*Pi*n)*exp(1/2*I*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*Pi*n)*exp(-1/2*I
*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*Pi*n)*exp(1/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1
))^2*csgn(I/(exp(2*I*(d*x+c))+1))*Pi*n)*exp(-1/2*I*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3*Pi*n)*exp
(1/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*Pi*n)*e
xp(4*I*c)*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c)))^3*Pi*n)*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))
^3*Pi*n)+3/((exp(2*I*(d*x+c))+1)^n)*(exp(I*(Re(d*x)+Re(c)))^n)^2*a^n*2^n*exp(-2*n*Im(d*x)-2*n*Im(c))*exp(-1/2*
I*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I/(exp(2*I*(d*x+c))+1))*Pi*n)*ex
p(-1/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*
a)*Pi*n)*exp(1/2*I*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I*a)*Pi*n)*exp(4*I*d*x)*exp(I*csgn(I
*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+c)))*Pi*n)*exp(1/2*I*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(2*I*(d*x+c))/(
exp(2*I*(d*x+c))+1))^2*Pi*n)*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2*Pi*n)*exp(1/2*I*csgn
(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2*csgn(I/(exp(2*I*(d*x+c))+1))*Pi*n)*exp(-1/2*I*csgn(I*a/(exp(2*I*(d
*x+c))+1)*exp(2*I*(d*x+c)))^3*Pi*n)*exp(1/2*I*csgn(I*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))*csgn(I*a/(exp(2*I*
(d*x+c))+1)*exp(2*I*(d*x+c)))^2*Pi*n)*exp(4*I*c)*exp(-1/2*I*csgn(I*exp(2*I*(d*x+c)))^3*Pi*n)*exp(-1/2*I*csgn(I
*exp(2*I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3*Pi*n))

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{4}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*(a+I*a*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

integrate((I*a*tan(d*x + c) + a)^n*sec(d*x + c)^4, x)

________________________________________________________________________________________

mupad [B]  time = 2.44, size = 216, normalized size = 3.32 \[ -\frac {4\,{\left (\frac {a\,\left (\cos \left (2\,c+2\,d\,x\right )+1+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,c+2\,d\,x\right )+1}\right )}^n\,\left (n\,3{}\mathrm {i}+\cos \left (2\,c+2\,d\,x\right )\,15{}\mathrm {i}+\cos \left (4\,c+4\,d\,x\right )\,6{}\mathrm {i}+\cos \left (6\,c+6\,d\,x\right )\,1{}\mathrm {i}-9\,\sin \left (2\,c+2\,d\,x\right )-6\,\sin \left (4\,c+4\,d\,x\right )-\sin \left (6\,c+6\,d\,x\right )+n\,\cos \left (2\,c+2\,d\,x\right )\,4{}\mathrm {i}+n\,\cos \left (4\,c+4\,d\,x\right )\,1{}\mathrm {i}-2\,n\,\sin \left (2\,c+2\,d\,x\right )-n\,\sin \left (4\,c+4\,d\,x\right )+10{}\mathrm {i}\right )}{d\,\left (n^2+5\,n+6\right )\,\left (15\,\cos \left (2\,c+2\,d\,x\right )+6\,\cos \left (4\,c+4\,d\,x\right )+\cos \left (6\,c+6\,d\,x\right )+10\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(c + d*x)*1i)^n/cos(c + d*x)^4,x)

[Out]

-(4*((a*(cos(2*c + 2*d*x) + sin(2*c + 2*d*x)*1i + 1))/(cos(2*c + 2*d*x) + 1))^n*(n*3i + cos(2*c + 2*d*x)*15i +
 cos(4*c + 4*d*x)*6i + cos(6*c + 6*d*x)*1i - 9*sin(2*c + 2*d*x) - 6*sin(4*c + 4*d*x) - sin(6*c + 6*d*x) + n*co
s(2*c + 2*d*x)*4i + n*cos(4*c + 4*d*x)*1i - 2*n*sin(2*c + 2*d*x) - n*sin(4*c + 4*d*x) + 10i))/(d*(5*n + n^2 +
6)*(15*cos(2*c + 2*d*x) + 6*cos(4*c + 4*d*x) + cos(6*c + 6*d*x) + 10))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n} \sec ^{4}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4*(a+I*a*tan(d*x+c))**n,x)

[Out]

Integral((I*a*(tan(c + d*x) - I))**n*sec(c + d*x)**4, x)

________________________________________________________________________________________